<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>1-数组循环相关</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.1.4/jquery.js" type="text/javascript"></script>
</head>
<body>
    <script type="text/javascript">
        //原型对象
        console.log(Array.prototype);
        console.log('ES5................');
        var arr = [1,6,9];
        arr.forEach(function(val,index,arr){
            console.log('元素::'+val);
            console.log('索引::'+index);
            console.log(arr);
        });
        console.log('原生JS................');
        /**
         * 循环数组的方法
         */
        for(var i=0;i<arr.length;i++){
            console.log(arr[i]);
        }
        console.log('Jquery................');
        /**
         * Jquery里面循环的
         */
        $.each(arr,function(index,val){
            console.log(index);
            console.log(val);
        });
        
    </script>
</body>
</html>